<#import "../macro/components.ftl" as components/>
<#include "../macro/layout_default.ftl"/>

<@head>
<link rel="stylesheet" href="/misc/app/css/product_list.css"/>
</@head>

<@body>
</@body>

<@layout_default>
<div class="box">
    <div class="box-header with-border">
        <span class="pull-right text-muted">共 ${pagelist.resultTotal} 条记录</span>
        <form class="form-inline" action="/qrcode/detail">
            <input type="hidden" value="${id}" name="id">
            <div class="input-group">
                <div class="input-group-addon">二维码ID：</div>
                <input type="text" class="form-control" style="width: 200px" name="qrId" value="${qrId!}" />
            </div>
            <div class="input-group">
                <div class="input-group-addon">产品名称：</div>
                <input type="text" class="form-control" style="width: 200px" name="proName" value="${proName!}"/>
            </div>

            <div class="input-group">
                <div class="input-group-addon">状态：</div>
                <select class="form-control" name="state">
                    <option value="">全部</option>
                    <option value="1" ${(state?exists && state == 1)?string("selected","")}>正常</option>
                    <option value="2" ${(state?exists && state == 2)?string("selected","")}>解绑</option>
                </select>
            </div>

            <button type="submit" class="btn btn-warning"><i class="fa fa-search"></i> 查询</button>

        </form>
       
        
    </div>

    <!-- /.box-header -->
    <div class="box-body">
        <table class="table table-striped table-hover">
            <tr>
                <th>ID</th>
                 <th>绑定商品</th>
                <th>二维码编号</th>
                <th>二维码明码</th>
                <th>初次扫描时间</th>
                <th>扫描次数</th>
                <th>状态</th>
               
            </tr>
            <#list pagelist.result as item>
                <tr>
                    <td>${item.id}</td>
                      <td>${item.pname!}</td>
                    <td>${item.uuid}</td>
                    <td>${item.show_code}</td>
                    <td>
                    <#if (item.first_scan_time!0) !=0>
                     	${(item.first_scan_time!0)?number_to_datetime}
                    </#if>
                    </td>
                    <td>${item.scan_times!0}</td>
                     <td>
                     <#if item.sta ==1>
                     	<span class="text-green">正常</span>
                     <#elseif item.sta==2>
                     	<span class="text-red">解绑</span>
                     <#else>
                     	<span class="text-danger">作废</span></#if>
                     </td>
                  
                  
                </tr>
            </#list>
        </table>
    </div>
    <!-- /.box-body -->
    <div class="box-footer text-center">
        <@components.pagination "/qrcode/detail?id=${id!}&proName=${proName!}&qrId=${qrId!}&state=${state!}&page=$page",pagelist.page,pagelist.pageTotal/>
    </div>
</div>





</@layout_default>